﻿CREATE TABLE [dbo].[ToolFileMap] (
    [stream_id] UNIQUEIDENTIFIER NOT NULL,
    [ToolID]    INT              NOT NULL,
    CONSTRAINT [PK_ToolFileMap] PRIMARY KEY CLUSTERED ([stream_id] ASC),
    CONSTRAINT [FK_ToolFileMap_Tool] FOREIGN KEY ([ToolID]) REFERENCES [dbo].[Tool] ([ToolID]),
    CONSTRAINT [FK_ToolFileMap_ToolFile] FOREIGN KEY ([stream_id]) REFERENCES [dbo].[ToolFile] ([stream_id]) ON DELETE CASCADE
);

